<me:UIVKPOS x:Class="WPFExcelReport.TJLTVK02"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml" 
    xmlns:ucd="clr-namespace:ReflectionStudio.Controls;assembly=ReflectionStudio.Controls"
    xmlns:UserControls="clr-namespace:ReflectionStudio.Components.UserControls;assembly=ReflectionStudio.Controls"
    xmlns:Localization="clr-namespace:Localization;assembly=Localization"
    xmlns:VK="clr-namespace:WPFExcelReport;assembly=TVKKOPF"
    xmlns:me="clr-namespace:WPFExcelReport"
    xmlns:KD="clr-namespace:WPFExcelReport;assembly=TKDSTAMM"   
   xmlns:SD="clr-namespace:WPFExcelReport;assembly=TSDDAT"   
    xmlns:VF="clr-namespace:WPFExcelReport;assembly=TVAFARBEN"
    xmlns:ChartEx="clr-namespace:WPFExcelReport.Chart;assembly=ITXVIEWS"
    xmlns:ZA="clr-namespace:WPFExcelReport;assembly=TZABED"  
   xmlns:TXT="clr-namespace:WPFExcelReport;assembly=TTXTIND"
     xmlns:T="clr-namespace:WPFExcelReport;assembly=IntexBL" 
    x:Name="TV"
    Loaded="Window_Loaded"
 >
    <me:UIVKPOS.Resources>
        <CollectionViewSource   x:Key="vwMaster" />
        <ucd:Divideby10  x:Key="d10"/>
        <ucd:Divideby100  x:Key="d100"/>
        <ucd:BM2YD x:Key="BM2YD"/>
        <ucd:Divideby1000  x:Key="d1000"/>
        <ucd:PNumConverter x:Key="pnum"/>
        <ucd:TextTrimmingConverter  x:Key="trim"/>
        <ucd:GB2312Convert8859P1  x:Key="gb2312"/>
    </me:UIVKPOS.Resources>
    <Grid>
        <Grid.RowDefinitions>
            <RowDefinition   Height="Auto" />
            <RowDefinition   Height="1*" />
            <RowDefinition   Height="Auto" />
        </Grid.RowDefinitions>

        <StackPanel Grid.Row="0" >
            <WrapPanel >
                <Button Grid.Column="0" Height="20"  Width="24" Margin="0,0,0,0" Click="PrintCommand" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Print.png" />
                    </Button.Background>
                </Button>
                <TextBlock Grid.Column="1"  Margin="10,0,0,0" 
                                   Text="{Binding Source={Localization:Translate Word=打印}}"/>


                <me:TSACHBE SACHBE="{Binding SACHBE,ElementName=TV}" 
                                IsEdit="True"
                                MinWidth="100"/>
                <KD:TSKD02 KEY="{Binding KUNDNR,ElementName=TV}" 
                               IsEdit="True"
                               MinWidth="100"/>
                <SD:K8884  Grid.Column="2" 
                               KEY="{Binding AUFART,ElementName=TV}" 
                               Width="100"
                               Visibility="Collapsed"
                               IsEdit="True"
                                EXAUF="{Binding AUFART,ElementName=TV }"/>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=销售单}}"/>
                    <TextBox Grid.Column="1" Text="{Binding KRS,ElementName=TV}" Width="40"/>
                    <TextBox Grid.Column="2" Text="{Binding LFD,ElementName=TV}" 
                                 KeyUp="Query_KeyUp"
                                 Width="80"/>
                </Grid>
                <Button Grid.Column="0" Height="20"  Width="24" Margin="0,0,0,0" Click="QueryCommand" >
                    <Button.Background>
                        <ImageBrush  ImageSource="/ImagePackage;component/Images/Search.png" />
                    </Button.Background>
                </Button>
            </WrapPanel>
            <WrapPanel>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=交期自}}"/>
                    <TextBox Grid.Column="1" Text="{Binding DTSTART,ElementName=TV}"  Width="80"/>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=至}}"/>
                    <TextBox Grid.Column="1" Text="{Binding DTEND,ElementName=TV}"  Width="80"/>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=规格}}"/>
                    <TextBox Grid.Column="1" Text="{Binding CART,Converter={StaticResource gb2312},ElementName=TV}"  Width="150"/>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=下单日期从}}"/>
                    <TextBox Grid.Column="1" Text="{Binding NEUDATS,ElementName=TV}"  Width="80"/>
                </Grid>
                <Grid>
                    <Grid.ColumnDefinitions>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                        <ColumnDefinition Width="Auto"></ColumnDefinition>
                    </Grid.ColumnDefinitions>
                    <TextBlock Grid.Column="0" Text="{Binding Source={Localization:Translate Word=至}}"/>
                    <TextBox Grid.Column="1" Text="{Binding NEUDATE,ElementName=TV}"  Width="80"/>
                </Grid>
            </WrapPanel>
        </StackPanel> 
        <DataGrid Grid.Row="1" 
                  AutoGenerateColumns="False" 
                  EnableRowVirtualization="False" 
                  Name="dlgMaster"
                  MaxHeight="200"
                  ItemsSource="{Binding Source={StaticResource ResourceKey=vwMaster}}" 
                  HeadersVisibility="Column"  CanUserReorderColumns="True" CanUserResizeRows="True"  
                  RowDetailsVisibilityMode="VisibleWhenSelected"
                  VerticalAlignment="Stretch"
                  EnableColumnVirtualization="True" 
                  HorizontalScrollBarVisibility="Auto" VerticalScrollBarVisibility="Auto">
            <DataGrid.Columns>

                <DataGridTextColumn Binding="{Binding Path=VKPAUFLFD, Converter={StaticResource ResourceKey=pnum}}" Header="{Binding Source={Localization:Translate Word=销售单}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPART}" Header="{Binding Source={Localization:Translate Word=面料}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPFARBE, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=色号}}" Width="Auto"   />
                <DataGridTextColumn Binding="{Binding Path=VKPMENGE1, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=数量}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPMEEH}" Header="{Binding Source={Localization:Translate Word=单位}}" Width="Auto" />
                <DataGridTextColumn Binding="{Binding Path=VKPRESERV, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=预留}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPFREIGE, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=确认(米)}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPFREIGE, Converter={StaticResource ResourceKey=BM2YD}}" Header="{Binding Source={Localization:Translate Word=确认(码)}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPVERS, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=发货}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPFAKT, Converter={StaticResource ResourceKey=d100}}" Header="{Binding Source={Localization:Translate Word=开票}}" Width="Auto"/>
                <DataGridTextColumn Binding="{Binding Path=VKPLIEFTERM}" Header="{Binding Source={Localization:Translate Word=交期}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=KDKUNDNA}" Header="{Binding Source={Localization:Translate Word=客户}}"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKCOM, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=成份}}"   Width="Auto"  MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VKPKDFARBNR, Converter={StaticResource ResourceKey=trim}}" Header="{Binding Source={Localization:Translate Word=客人色号}}" Width="Auto" MinWidth="100"/>
                <DataGridTextColumn Binding="{Binding Path=VKKBESTNR}" Header="{Binding Source={Localization:Translate Word=合同号}}"  Width="Auto" MinWidth="40"/>
                <DataGridTextColumn Binding="{Binding Path=VAAPRGR}" Header="{Binding Source={Localization:Translate Word=用途}}"   Width="Auto"  MinWidth="24"/>
                <DataGridTextColumn Binding="{Binding Path=VKPNEUDAT}" Header="{Binding Source={Localization:Translate Word=创建日期}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPNEUBEN}" Header="{Binding Source={Localization:Translate Word=跟单}}" Width="Auto" MinWidth="30" />
                <DataGridTextColumn Binding="{Binding Path=VKPSACHBE}" Header="{Binding Source={Localization:Translate Word=负责人}}" Width="Auto" MinWidth="30" />
            </DataGrid.Columns>
        </DataGrid>
        <WrapPanel Grid.Row="2"  >
            <TextBlock Text="{Binding TKEY1}"  Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM1,Converter={StaticResource d100}}" Foreground="Red" Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding TKEY2}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM2}" Foreground="Red" Margin="10,0,0,0"/>
            <TextBlock Text="{Binding TKEY3}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding SUM3}" Foreground="Red" Margin="10,0,0,0"/>
            <TextBlock Text="{Binding TCOUNT1}"   Margin="10,0,0,0"></TextBlock>
            <TextBlock Text="{Binding Counts}" Foreground="Red" Margin="20,0,0,0"/>
            <WrapPanel Grid.Row="2" Grid.Column="0" Grid.ColumnSpan="2">
                <CheckBox  IsChecked="{Binding IsShowVK,ElementName=TV}" Content="{Binding Source={Localization:Translate Word=订单信息}}" FontWeight="DemiBold" FontSize="18"></CheckBox>
                <CheckBox  IsChecked="{Binding IsShowTG,ElementName=TV}" Content="{Binding Source={Localization:Translate Word=统计信息}}" FontWeight="DemiBold" FontSize="18"></CheckBox>
                <CheckBox  IsChecked="{Binding IsShowVV,ElementName=TV}" Content="{Binding Source={Localization:Translate Word=发货信息}}"  FontWeight="DemiBold"   FontSize="18"></CheckBox>
                <CheckBox  IsChecked="{Binding IsShowAB,ElementName=TV}" Content="{Binding Source={Localization:Translate Word=生产信息}}"  FontWeight="DemiBold"  FontSize="18"></CheckBox>
                <CheckBox  IsChecked="{Binding IsShowSY,ElementName=TV}" Content="{Binding Source={Localization:Translate Word=S样评价}}"  FontWeight="DemiBold"  FontSize="18"></CheckBox>
                <CheckBox Visibility="Collapsed" IsChecked="{Binding IsShowCP,ElementName=TV}" Content="{Binding Source={Localization:Translate Word=生产评价}}"  FontWeight="DemiBold"  FontSize="18"></CheckBox>
            </WrapPanel>
        </WrapPanel>
    </Grid>
</me:UIVKPOS>
